package Game.Buff;

import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;

import Game.Objects.GOPlayer;
import Game.Objects.GameObject;
import Game.Objects.Creatures.GOCreature;

/** Buff Strength class
 * Description: added some damage to base damage
 * @author Aikidos
 */
public class BuffStrength extends BuffBase {

	// Stats
	private int _addDamage;
	
	public BuffStrength(BuffManager buffManager) throws SlickException {
		super(buffManager);
		
		setNumOfSteps(10);
		
		_icon = new Image("res/gfx/buff/strength.png");
	}
	
	@Override
	public void init() {
		super.init();
		
		// Set stats
		_addDamage = 3;
		
		GameObject obj = getBuffManager().getOwner();
		
		// Player
		if (obj.isPlayer()) {
			GOPlayer player = (GOPlayer)obj;
			
			player.MinDamage += _addDamage;
			player.MaxDamage += _addDamage;
		}
		
		// Creature
		if (obj.isCreature()) {
			GOCreature creature = (GOCreature)obj;
			
			creature.MinDamage += _addDamage;
			creature.MaxDamage += _addDamage;
		}
	}

	@Override
	public void shutdown() throws SlickException {
		super.shutdown();
		
		GameObject obj = getBuffManager().getOwner();
		
		// Player
		if (obj.isPlayer()) {
			GOPlayer player = (GOPlayer)obj;
			
			player.MinDamage -= _addDamage;
			player.MaxDamage -= _addDamage;
		}
		
		// Creature
		if (obj.isCreature()) {
			GOCreature creature = (GOCreature)obj;
			
			creature.MinDamage -= _addDamage;
			creature.MaxDamage -= _addDamage;
		}
	}
	
}
